<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>过渡案例</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .outer {
            margin: 0 auto;
            margin-top: 100px;
            width: 400px;
            height: 224px;
            overflow: hidden;
            position: relative;
        }
        .outer-span {
            width: 400px;
            height: 224px;
            font-size: 100px;
            color: white;
            position: absolute;
            left: 0;
            top: 0;
            text-align: center;
            line-height: 224px;
            /*black透明度0.5就可以实现魔镜*/
            background-color: black;
            /*用透明度0代替隐藏*/
            opacity: 0;
            transition: 0.3s all linear;
        }
        .outer >img{
            transition: 0.5s all linear;
        }
        /*不知道如何把底下的div覆盖上去，覆盖上去img就不是hove了*/
        /*找最外层hover,如果找里层会进不去,也就是如果是一个hover改同一级，需要外层一个div hover修改他们两个*/
        .outer:hover .outer-span{
            opacity: 0.5;
            cursor: pointer;
        }
        .outer:hover .outer-img{
            transform: scale(1.6) rotateZ(20deg);
        }
    </style>
</head>

<body>
    <div class="outer">
        <img src="../images/shanghai.jpg" class="outer-img">
        <div class="outer-span">上海</div>
    </div>

</body>

</html>